home *** CD-ROM | disk | FTP | other *** search
- # CVS $Id: label.tcl,v 1.7 1995/03/28 11:07:40 zibi Exp $
- #
- # This should be a minimal test of the label widgets
- #
- # It does some attachment as well as setting of one label and one
- # push button.
- #
-
- source tools.tcl
-
- set ap [VtOpen "foo"]
-
- set dlog [VtFormDialog $ap.labels -title "Labels" \
- -okLabel Exit\
- -okCallback QuitCB ]
-
-
- set rc [VtRowColumn $dlog.rc -rightSide FORM -leftSide FORM -bottomSide FORM]
-
- # Add each label into the rowcolum using various resources
- VtPushButton $rc.left -label "Left Aligned" -labelLeft
- VtPushButton $rc.center -label "Center Aligned" -labelCenter
- VtPushButton $rc.right -label "Right Aligned" -labelRight
-
- # pixmaps to set
- if {[file exists /usr/include/X11/bitmaps/woman]} {
- set monoPix /usr/include/X11/bitmaps/woman
- } else {
- if { [ catch {set monoPix $env(VTCL_HOME)/tests/friend.px} errorMsg ] != 0 } {
- set monoPix /lib/vtcl/tests/friend.px
- }
- }
-
- if {[file exists /usr/include/X11/bitmaps/xdt_p_large/Paint.px]} {
- set colorPix /usr/include/X11/bitmaps/xdt_p_large/Paint.px
- } else {
- if { [ catch {set colorPix $env(VTCL_HOME)/tests/file.px} errorMsg ] != 0 } {
- set colorPix /lib/vtcl/tests/file.px
- }
- }
-
- if {[file exists /usr/include/X11/bitmaps/xdt_p_large/Mail.px]} {
- set colorPix2 /usr/include/X11/bitmaps/xdt_p_large/Mail.px
- } else {
- if { [ catch {set colorPix2 $env(VTCL_HOME)/tests/dir.px} errorMsg ] != 0 } {
- set colorPix2 /lib/vtcl/tests/dir.px
- }
- }
-
- # Add a bitmap and let label generate an insensitive pixmap
- VtPushButton $rc.pixmap -pixmap $monoPix
-
- set insen [VtPushButton $rc.insen -pixmap $monoPix]
- VtSetSensitive $insen 0
-
- # Add a pixmap and let label generate an insensitive pixmap
- VtPushButton $rc.cpixmap -pixmap $colorPix
-
- set cinsen [VtPushButton $rc.cinsen -pixmap $colorPix]
- VtSetSensitive $cinsen 0
-
- # Add a pixmap and insensitive pixmap make sure that
- # the insensitive pixmap overrides the generated default
- set i3 [VtPushButton $rc.pixmap2 -pixmap $colorPix \
- -insensitivePixmap $colorPix2]
-
- VtSetSensitive $i3 0
-
- VtShow $dlog
- VtMainLoop
-
-
-